var fs  = require("fs");
var exec = require('child_process').exec;
fs.readFile('bower.json',function(err,buf){
    console.log(buf);
    var deps = JSON.parse(buf.toString()).dependencies;
    for(var k in deps){
        exec('bower install ' + k + ' --save',function(error,stdout,stderr){
            console.log('stdout: ' + stdout);
            console.log('stderr: ' + stderr);
            if (error !== null) {
                console.log('exec error: ' + error);
            }
        });
    }
});